<script setup>
	import {
		onLaunch,
		onShow,
		onHide
	} from '@dcloudio/uni-app';
	import {
		useMainStore
	} from '@/stores/index.js';

	const mainStore = useMainStore();

	onLaunch(() => {
		// uni.hideTabBar();
		const info = uni.getWindowInfo();
		mainStore.$patch({
			System: info,
			statusBarHeight: info.statusBarHeight,
			windowHeight: info.windowHeight,
			safeAreaInsets: info.safeAreaInsets,
		});

		// #ifdef MP-WEIXIN
		const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
		const navBarHeight =
			menuButtonInfo.bottom -
			info.statusBarHeight +
			(menuButtonInfo.top - info.statusBarHeight);
		mainStore.$patch({
			navWidth: menuButtonInfo.left,
			navBarHeight: navBarHeight,
			capsuleWidth: menuButtonInfo.width + 7,
			totalHeight: info.statusBarHeight + navBarHeight,
			chatHomeList: [],
		});
		// #endif
	});

	onShow(() => {});

	onHide(() => {});
</script>

<style lang="scss">
	@import 'uview-plus/index.scss';
	@import '@/styles/base.scss';
	@import url('@/styles/iconfont.css');
	@import url('@/styles/common.css');
</style>